
import type { Api_Response_Dto } from '@/dto/response/Api_Response_Dto';
import request from '@/utils/request'
/**
 * 获取单个部门列表
 * @param obj
 * @returns
 */
export const Get_Dept = (obj:{id:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Get_Dept",
        method: "get",
       params:obj
    });
}
/**
 * 获取部门列表
 * @param obj
 * @returns
 */
export const Get_Depts = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Get_Depts",
        method: "get",
    });
}
/**
 * 获取部门下员工列表
 * @param obj
 * @returns
 */
export const Get_Dept_Users = (obj: any):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Get_Dept_Users",
        method: "get",
       params: obj,
    });
}


/**
 * 新增部门
 * @param obj
 * @returns
 */
export const Add_Dept = (obj: { name:string,dlv:number,explain:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Add_Dept",
        method: "post",
       data: obj,
    });
}

/**
 * 删除部门
 * @param obj
 * @returns
 */
export const Get_Del = (obj: { id:string }):
    Promise<Api_Response_Dto> => {
    return request({
        url: "/api/org/Get_Del",
        method: "get",
        params: obj
    });
}

/**
 * 新增用户
 * @param obj
 * @returns
 */
export const Add_User = (obj: { name:string,account:string,dept:string,gender:string,duty:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "/api/org/Add_User",
        method: "post",
        data: obj
    });
}



/**
 * 获取职务列表
 * @param obj
 * @returns
 */
export const Get_Duty = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Get_Duty",
        method: "get",
    });
}
/**
 * 获取职务列表
 * @param obj
 * @returns
 */
export const Get_duty_xla = ():
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Get_duty_xla",
        method: "get",
    });
}

/**
 * 获取职务列表
 * @param obj
 * @returns
 */
export const Add_Duty = (obj: { name:string,dlv:number,explain:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Add_Duty",
        method: "post",
        data: obj
    });
}

/**
 * 修改部门详情
 * @param obj
 * @returns
 */
export const Update_dept = (obj: {id:string;name:string,dlv:number,explain:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Update_dept",
        method: "post",
        data: obj
    });
}
/**
 * 修改职务详情
 * @param obj
 * @returns
 */
export const Get_DutyDetails = (obj: {id:string}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Get_DutyDetails",
        method: "get",
        params: obj
    });
}
/**
 * 修改职务
 * @param obj
 * @returns
 */
export const Update_Duty = (obj: {id:string,name:string,dlv:string,dexplain:string,isBan:number}):
    Promise<Api_Response_Dto> => {
    return request({
        url: "api/org/Update_Duty",
        method: "post",
        data: obj
    });
}
